package com.company.cloud.user.modules.demo.controller;

import cn.hutool.core.util.IdUtil;
import cn.hutool.core.util.StrUtil;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.company.cloud.common.auth.annotation.Login;
import com.company.cloud.common.bean.BaseParam;
import com.company.cloud.common.bean.BaseResult;
import com.company.cloud.common.bean.LoginSimpleUserInfo;
import com.company.cloud.common.utils.AuthContextUtils;
import com.company.cloud.common.utils.SpringContextUtils;
import com.company.cloud.user.modules.base.entity.TeamInfo;
import com.company.cloud.user.modules.cache.models.TeamModel;
import com.company.common.server.config.cloud.ProjectConfig;
import com.company.common.server.config.mq.utils.SaasMqUtils;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.log4j.Log4j2;
import org.apache.activemq.command.ActiveMQQueue;
import org.apache.activemq.command.ActiveMQTopic;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.jms.core.JmsMessagingTemplate;
import org.springframework.util.CollectionUtils;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.jms.Queue;
import javax.jms.Topic;


@Log4j2
@RestController
@RequestMapping("/app/mq")
public class MqTestController {



    @Autowired
    private ProjectConfig projectConfig;

//    @GetMapping("/queue")
//    public BaseResult queue() {
//        System.out.println("queue");
//        for (int i=0;i<=10;i++) {
//            SaasMqUtils.produce("queue1","queue__" + IdUtil.simpleUUID() + "---" + i,false,projectConfig);
//        }
//        return BaseResult.ok(projectConfig);
//    }

//    @GetMapping("/topic")
//    public BaseResult topic() {
//        System.out.println("topic");
//        for (int i=0;i<=10;i++){
//            SaasMqUtils.produce("topic1","topic__" + IdUtil.simpleUUID() + "---" + i,true,projectConfig);
//        }
//        return BaseResult.ok(projectConfig);
//    }



}
